#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e6 + 10;
int n, a[N], vis[N], ans;
signed main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);

    cin >> n;
    if(n <= 300)
    {
        for(int i = 1; i <= n; i++)  cin >> a[i];
        sort(a + 1, a + n + 1);
        for(int i = 1; i < n; i++)
        {
            for(int j = i + 1; j <= n; j++)
            {
                if(a[i] == a[j])  continue;
                else if(a[j] > a[i] && vis[j] != 1)
                {
                    ans++;
                    vis[j] = 1;
                    if(j == n)
                    {
                        cout << n - ans << "\n";
                        return 0;
                    }
                    break;
                }
            }
        }
        cout << n - ans << "\n";
    }
    else
    {
        int c1 = 0, c2 = 0;
        for(int i = 1; i <= n; i++)
        {
            cin >> a[i];
            if(a[i] == 1)  c1++;
            else c2++;
        }
        if(c1 <= c2)  cout << c2 << "\n";
        else  cout << c1 << "\n";
   }
    return 0;
}
